﻿@using SH = EMoney.IStock.Client.Framework.StringHelper;

<div class="ind_l">
    <div class="add_k">       
        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="dtTH">
            <tr>
                <th align="center" style="width:20%;color:#666;">利器名称</th>
                <th align="center" style="width:20%;color:#666;">类别</th>
                <th align="center" style="width:20%;color:#666;">到期日期</th>
                <th align="center" style="width:20%;color:#666;">状态</th>
                <th align="center" style="width:20%;color:#666;">操作</th>
            </tr>
        </table>
        <div id="scrollBox1" class="scrollBox" scrollflag style="height:245px;">
            <table width="100%" id="dtTD" border="0" cellspacing="0" cellpadding="0">
                <thead style="height: 0px; display: none;">
                    <tr>
                        <th align="center">利器名称</th>
                        <th align="center">类别</th>
                        <th align="center">到期日期</th>
                        <th align="center">状态</th>
                        <th align="center">操作</th>
                    </tr>
                </thead>
                <tbody id="bodyRights"></tbody>
            </table>
        </div>
    </div>
</div>
<div class="ind_r" id="divAd"></div>
<script type="text/javascript">
    var data = ISTOCK_FUNC_GETUSERRIGHTS();

    if (data != "") {
        var obj = eval(data);

        if (obj != null && obj.length > 0)
        {
            var rightsHtml = "", now = new Date(), expireTips = "", color = "";

            $.each(obj, function (i) {
                if (compareDate(now, new Date(obj[i].enddate))) {
                    expireTips = "已到期";
                    color = "style=color:red;";
                }
                else {
                    expireTips = "未到期";
                    color = "";
                }

                rightsHtml += "<tr>";
                rightsHtml += "<td align=\"center\" style=\"width:20%;\">" + obj[i].name + "</td>";
                rightsHtml += "<td align=\"center\" style=\"width:20%;\">" + obj[i].group + "</td>";
                rightsHtml += "<td align=\"center\" style=\"width:20%;\">" + obj[i].enddate + "</td>";
                rightsHtml += "<td align=\"center\" style=\"width:20%;\">" + expireTips + "</td>";
                rightsHtml += "<td align=\"center\" style=\"width:20%;\"><a href='" + obj[i].storeurl + "' " + color + " target='_blank' hidefocus='true'>续费</a></td>";
                rightsHtml += "</tr>";
            });

            $("#bodyRights").html(rightsHtml);
        }
    }

    function formaturl(url)
    {
        if (url != undefined && url != "")
        {
            var arrUrl = url.split("?");

            if (arrUrl != null && arrUrl.length == 2)
            {
                if (arrUrl[1].indexOf("from=ucenter") == -1) {
                    return "http://i.emoney.cn/promotion/redirect?" + arrUrl[1] + "&from=ucenter";
                }
                else {
                    return "http://i.emoney.cn/promotion/redirect?" + arrUrl[1];
                }
            }
        }
    }

    $("#scrollBox1").height(245);

    $(".scrollBox").jscroll({ W: "8px", IW: "8px", CurrT: 0, Bar: { Pos: "up" }, Btn: { btn: false }, Fn: function () { } }).hover(function (e) {
        var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
        if (!scrlbr.hasClass("non")) {
            scrlbr.addClass("mon").stop(true, true, false).show();
        }
    }, function (e) {
        var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
        if (!scrlbr.hasClass("non")) {
            scrlbr.removeClass("mon");
            if (scrlbr.hasClass("vxdrag")) { } else {
                //scrlbr.fadeOut("slow");
            }
        }
    });

    ReSetScroll();
</script>